<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    const add = (...args) => {
      // args 匹配到所有的参数，是数组类型
      let result = 0
      for (let i = 0; i < args.length; i++) {
        result += args[i]
      }
      return result
    }
    console.log(add(1, 5, 10, 110))  // 126
  </script>
</body>

</html>